package com.leezk.order.controller;

import com.leezk.order.constant.CommonConstant;
import com.leezk.order.dto.ResultDTO;
import com.leezk.order.dto.SystemMsg;
import com.leezk.order.entity.Admin;
import com.leezk.order.service.IAdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping(CommonConstant.API_URI_VERSION_V1+"/admin")
public class AdminController {
    @Autowired
    private IAdminService adminService;

    @PostMapping("/login")
    private ResultDTO<String> adminLogin(@RequestBody Admin admin){
        return ResultDTO.success(adminService.login(admin));
    }

    @GetMapping("/getSystemMsg")
    public ResultDTO<SystemMsg> getSystemMsg(){
        return ResultDTO.success(adminService.getSystemMsg());
    }
}
